#pragma once

#include<iostream>
#include<string>
#include<cstring>
#include<cstdlib>
#include<memory>
#include<unistd.h>    //close 头文件
#include<functional>

//四大网络头文件
#include<sys/socket.h>
#include<sys/types.h>
#include<arpa/inet.h>
#include<netinet/in.h>   

//退出码常量（枚举是个整数）
enum ExitCode
{
    OK = 0,
    USAGE_ERR, 
    SOCKET_ERR,    //创建套接字失败
    BIND_ERR,       //绑定失败
    LISTEN_ERR,
    CONNECT_ERR,
    FORK_ERR
}; 

class NoCopy
{
public:
    NoCopy(){}
    ~NoCopy(){}
    //把 拷贝构造和赋值重载都delete
    NoCopy(const NoCopy &) = delete;
    const NoCopy &operator = (const NoCopy&) = delete;
};

#define CONV(addr) ((struct sockaddr*)&addr)
